#ifndef LINE_H
#define LINE_H

#include "point.h"
namespace GeometryUtilities
{
  class Line
  {
    public:
      Line();
      Line(const GeometryUtilities::Point& p1, const GeometryUtilities::Point& p2);
      Line(qreal yIntercept, qreal slope);

      qreal yIntercept() const;
      qreal xIntercept() const;
      qreal slope() const;
      bool isVertical() const;
      bool isHorizontal() const;

      virtual bool isPointOn(const Point& p) const;
      virtual bool operator==(const Line& rhs) const;

    protected:
      qreal mYIntercept, mXIntercept;
      qreal mSlope;
      bool mIsVertical, mIsHorizontal;
  };
}

#endif // LINE_H
